package com.yfp.operation.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yfp.common.security.utils.SecurityUtils;
import com.yfp.operation.domain.MachineNetWarnDO;
import com.yfp.operation.domain.dto.WarnParameterDTO;
import com.yfp.operation.domain.vo.MachineErrorVO;
import com.yfp.operation.mapper.*;
import com.yfp.operation.mapper.*;
import com.yfp.operation.service.MachineNetWarnService;
import com.yfp.operation.service.MachineService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import jakarta.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

@Service
@Slf4j
public class MachineNetWarnServiceImpl extends ServiceImpl<MachineNetWarnMapper, MachineNetWarnDO> implements MachineNetWarnService {

    @Resource
    private MachineNetWarnMapper machineNetWarnMapper;
    @Resource
    private MachineExpireWarnMapper machineExpireWarnMapper;
    @Resource
    private MachineInventoryWarnMapper machineInventoryWarnMapper;
    @Resource
    private MachineTempWarnMapper machineTempWarnMapper;
    @Resource
    private MachineMapper machineMapper;
    @Resource
    private MachineService machineService;



    /**
     * 报警信息查询
     * @return
     */
    @Override
    public List<MachineErrorVO> getMachineWarn(WarnParameterDTO warnParameterDTO) {
        warnParameterDTO.setOperationUserId(  SecurityUtils.getUserId());
        List<MachineErrorVO> machinWarn = machineNetWarnMapper.getMachinWarn(warnParameterDTO);
        return machinWarn;
    }

    @Override
    public List<MachineNetWarnDO> getAll() {
        return machineNetWarnMapper.getAll();
    }

    @Override
    public List<MachineNetWarnDO> getLimitOne() {
        return machineNetWarnMapper.getLimitOne();
    }

    @Override
    public void insertAll(ArrayList<MachineNetWarnDO> machineNetWarnDOS) {
        machineNetWarnMapper.insertAll(machineNetWarnDOS);
    }
}
